package list01;

import java.util.ArrayList;

public class ArrayListUse01 {

    public static void main(String[] args) {


        ArrayList list = new ArrayList();

        list.add(0,"张三");
        list.add(1,"李四");
        list.add(2,"王五");






        list.remove(list.size() -2);
        System.out.println("" + list);


        list.set(0,"张三丰");
        System.out.println(list);


        list.set(1,"李四");
        System.out.println(list);




        for (int i = 0; i < list.size(); i++) {
            System.out.println(i + "----" + list.get(i));
        }


    }

}